<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}-我的博客</title>
    <link rel="stylesheet" href={% static 'bootstrap5/bootstrap.min.css' %}>
    <script src={% static 'bootstrap5/popper.min.js' %}></script>
    <script src={% static 'bootstrap5/bootstrap.min.js' %}></script>
    <link rel="stylesheet" href={% static 'css/base.css' %}>
    {% block head %}{% endblock %}
</head>
<body>
<header class="p-3 text-bg-success border-bottom mb-4">
    <div class="container">
        <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
            <a href="/static" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
                <img src={% static 'images/可爱的花猫.png' %}  class="rounded-circle" style="height:40px" alt="">
            </a>

            <ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
                <li><a href="/" class="nav-link px-2 text-white">首页</a></li>
                <li><a href="{% url 'blog:pub_blog' %}" class="nav-link px-2 text-white">发布博客</a></li>
            </ul>

            <form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" role="search" action="{% url 'blog:search' %}"
                  method="GET" }>
                <input type="search" name="q" class="form-control" placeholder="搜索..."
                       aria-label="Search">
            </form>
            {% if user.is_authenticated %}
                <div class="flex-shrink-0 dropdown">
                    <a href="#" class="d-block link-dark text-decoration-none dropdown-toggle" data-bs-toggle="dropdown"
                       aria-expanded="false">
                        <img src="{% static 'images/聪明的猫.png' %}" alt="mdo" width="40" height="40"
                             class="rounded-circle">
                    </a>
                    <ul class="dropdown-menu text-small shadow" style="">
                        <li><a class="dropdown-item" href="/pub">新发布</a></li>
                        <li><a class="dropdown-item" href="#">设置</a></li>
                        <li><a class="dropdown-item" href="#">个人信息</a></li>
                        <li>
                            <hr class="dropdown-divider">
                        </li>
                        <li><a class="dropdown-item" href="{% url 'sshauth:logout' %}">退出</a></li>
                    </ul>
                </div>

            {% else %}
                <div class="text-end">
                    <a type="button" class="btn btn-outline-light me-2" href="{% url 'sshauth:login' %}">登录</a>
                    <a type="button" class="btn btn-light" href="{% url 'sshauth:register' %}">注册</a>
                </div>
            {% endif %}

        </div>
    </div>
</header>
<main class="container bg-white p-2 rounded">
    {% block main %}
    {% endblock %}
</main>
</body>
</html>